package com.framework.SystemPage
{
	import com.framework.BasicButton;
	import com.framework.BasicPage;
	import com.framework.ButtonInfo;
	import com.framework.CustomEventButton;
	
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class PausePage extends BasicPage
	{
		
		public var btnBack:resBtnContinue;
		public var btnStageMode:resBtnList;
		public var btnReplay:resBtnReplay;
		public var btnNext:resBtnContinue;
		
		
		public var bgWindow:MovieClip;
		
		protected var btnMargin:int = 40;
		
		public function PausePage()
		{
			
			super();
		
			
		}
		
		override public function init(e:Event):void
		{
			super.init(e);
			
			bgWindow = new resPagePause;
			btnBack = new resBtnContinue;
			btnReplay =  new resBtnReplay;
			btnStageMode =  new resBtnList;
			
			this.addChild(bgWindow);
			this.addChild(btnBack);
			this.addChild(btnReplay);
			this.addChild(btnStageMode);
			
			setButton(btnBack,270,154);
			setButton(btnReplay,270 + btnMargin,154);
			setButton(btnStageMode,270 + btnMargin + btnMargin,154);
			
			
			btnBack.addEventListener(MouseEvent.CLICK,BackBtnListener);
			btnStageMode.addEventListener(MouseEvent.CLICK,ListBtnListener);
			btnReplay.addEventListener(MouseEvent.CLICK,ReplayBtnListener);
			
		}
		
		override public function update(e:Event):void
		{
			
		}
		
		
		public function BackBtnListener(e:MouseEvent):void
		{
			dispatchEvent(new CustomEventButton(CustomEventButton.BUTTON_ID,ButtonInfo.BUTTON_BACK,0));
			
		}
		
		public function ListBtnListener(e:MouseEvent):void
		{
			dispatchEvent(new CustomEventButton(CustomEventButton.BUTTON_ID,ButtonInfo.BUTTON_STAGE_MODE,0));
			
		}
		
		public function ReplayBtnListener(e:MouseEvent):void
		{
			dispatchEvent(new CustomEventButton(CustomEventButton.BUTTON_ID,ButtonInfo.BUTTON_REPLAY,0));
			
		}
		
		public function NextBtnListener(e:MouseEvent):void
		{
			dispatchEvent(new CustomEventButton(CustomEventButton.BUTTON_ID,ButtonInfo.BUTTON_NEXT_STAGE,0));
			
		}
		
		public function setButton(btn:Object,x:int,y:int):void
		{
			btn.x = x;
			btn.y = y;
		}
	}
}